<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var Q = function () {
            function t() {
                this.n = null,
                    this.e = 0,
                    this.d = null,
                    this.p = null,
                    this.q = null,
                    this.dmp1 = null,
                    this.dmq1 = null,
                    this.coeff = null
            }
            return t.prototype.doPublic = function (t) {
                    return t.modPowInt(this.e, this.n)
                },
                t.prototype.doPrivate = function (t) {
                    if (null == this.p || null == this.q)
                        return t.modPow(this.d, this.n);
                    for (var e = t.mod(this.p).modPow(this.dmp1, this.p), i = t.mod(this.q).modPow(this.dmq1, this
                            .q); e.compareTo(i) < 0;)
                        e = e.add(this.p);
                    return e.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i)
                },
                t.prototype.setPublic = function (t, e) {
                    null != t && null != e && t.length > 0 && e.length > 0 && (this.n = F(t, 16),
                        this.e = parseInt(e, 16))
                },
                t.prototype.encrypt = function (t) {
                    var e = function (t, e) {
                        if (e < t.length + 11)
                            return null;
                        for (var i = [], r = t.length - 1; r >= 0 && e > 0;) {
                            var n = t.charCodeAt(r--);
                            n < 128 ? i[--e] = n : n > 127 && n < 2048 ? (i[--e] = 63 & n | 128,
                                i[--e] = n >> 6 | 192) : (i[--e] = 63 & n | 128,
                                i[--e] = n >> 6 & 63 | 128,
                                i[--e] = n >> 12 | 224)
                        }
                        i[--e] = 0;
                        for (var a = new Z, o = []; e > 2;) {
                            for (o[0] = 0; 0 == o[0];)
                                a.nextBytes(o);
                            i[--e] = o[0]
                        }
                        return i[--e] = 2,
                            i[--e] = 0,
                            new E(i)
                    }(t, this.n.bitLength() + 7 >> 3);
                    if (null == e)
                        return null;
                    var i = this.doPublic(e);
                    if (null == i)
                        return null;
                    var r = i.toString(16);
                    return 0 == (1 & r.length) ? r : "0" + r
                },
                t.prototype.setPrivate = function (t, e, i) {
                    null != t && null != e && t.length > 0 && e.length > 0 && (this.n = F(t, 16),
                        this.e = parseInt(e, 16),
                        this.d = F(i, 16))
                },
                t.prototype.setPrivateEx = function (t, e, i, r, n, a, o, s) {
                    null != t && null != e && t.length > 0 && e.length > 0 && (this.n = F(t, 16),
                        this.e = parseInt(e, 16),
                        this.d = F(i, 16),
                        this.p = F(r, 16),
                        this.q = F(n, 16),
                        this.dmp1 = F(a, 16),
                        this.dmq1 = F(o, 16),
                        this.coeff = F(s, 16))
                },
                t.prototype.generate = function (t, e) {
                    var i = new Z,
                        r = t >> 1;
                    this.e = parseInt(e, 16);
                    for (var n = new E(e, 16);;) {
                        for (; this.p = new E(t - r, 1, i),
                            0 != this.p.subtract(E.ONE).gcd(n).compareTo(E.ONE) || !this.p.isProbablePrime(10);)
                        ;
                        for (; this.q = new E(r, 1, i),
                            0 != this.q.subtract(E.ONE).gcd(n).compareTo(E.ONE) || !this.q.isProbablePrime(10);)
                        ;
                        if (this.p.compareTo(this.q) <= 0) {
                            var a = this.p;
                            this.p = this.q,
                                this.q = a
                        }
                        var o = this.p.subtract(E.ONE),
                            s = this.q.subtract(E.ONE),
                            l = o.multiply(s);
                        if (0 == l.gcd(n).compareTo(E.ONE)) {
                            this.n = this.p.multiply(this.q),
                                this.d = n.modInverse(l),
                                this.dmp1 = this.d.mod(o),
                                this.dmq1 = this.d.mod(s),
                                this.coeff = this.q.modInverse(this.p);
                            break
                        }
                    }
                },
                t.prototype.decrypt = function (t) {
                    var e = F(t, 16),
                        i = this.doPrivate(e);
                    return null == i ? null : function (t, e) {
                        var i = t.toByteArray(),
                            r = 0;
                        for (; r < i.length && 0 == i[r];)
                            ++r;
                        if (i.length - r != e - 1 || 2 != i[r])
                            return null;
                        ++r;
                        for (; 0 != i[r];)
                            if (++r >= i.length)
                                return null;
                        var n = "";
                        for (; ++r < i.length;) {
                            var a = 255 & i[r];
                            a < 128 ? n += String.fromCharCode(a) : a > 191 && a < 224 ? (n += String
                                .fromCharCode((31 & a) << 6 | 63 & i[r + 1]),
                                ++r) : (n += String.fromCharCode((15 & a) << 12 | (63 & i[r + 1]) << 6 |
                                    63 & i[r + 2]),
                                r += 2)
                        }
                        return n
                    }(i, this.n.bitLength() + 7 >> 3)
                },
                t.prototype.generateAsync = function (t, e, i) {
                    var r = new Z,
                        n = t >> 1;
                    this.e = parseInt(e, 16);
                    var a = new E(e, 16),
                        o = this,
                        s = function () {
                            var e = function () {
                                    if (o.p.compareTo(o.q) <= 0) {
                                        var t = o.p;
                                        o.p = o.q,
                                            o.q = t
                                    }
                                    var e = o.p.subtract(E.ONE),
                                        r = o.q.subtract(E.ONE),
                                        n = e.multiply(r);
                                    0 == n.gcd(a).compareTo(E.ONE) ? (o.n = o.p.multiply(o.q),
                                        o.d = a.modInverse(n),
                                        o.dmp1 = o.d.mod(e),
                                        o.dmq1 = o.d.mod(r),
                                        o.coeff = o.q.modInverse(o.p),
                                        setTimeout(function () {
                                            i()
                                        }, 0)) : setTimeout(s, 0)
                                },
                                l = function () {
                                    o.q = R(),
                                        o.q.fromNumberAsync(n, 1, r, function () {
                                            o.q.subtract(E.ONE).gcda(a, function (t) {
                                                0 == t.compareTo(E.ONE) && o.q.isProbablePrime(10) ?
                                                    setTimeout(e, 0) : setTimeout(l, 0)
                                            })
                                        })
                                },
                                h = function () {
                                    o.p = R(),
                                        o.p.fromNumberAsync(t - n, 1, r, function () {
                                            o.p.subtract(E.ONE).gcda(a, function (t) {
                                                0 == t.compareTo(E.ONE) && o.p.isProbablePrime(10) ?
                                                    setTimeout(l, 0) : setTimeout(h, 0)
                                            })
                                        })
                                };
                            setTimeout(h, 0)
                        };
                    setTimeout(s, 0)
                },
                t.prototype.sign = function (t, e, i) {
                    var r = function (t, e) {
                        if (e < t.length + 22)
                            return null;
                        for (var i = e - t.length - 6, r = "", n = 0; n < i; n += 2)
                            r += "ff";
                        return F("0001" + r + "00" + t, 16)
                    }((X[i] || "") + e(t).toString(), this.n.bitLength() / 4);
                    if (null == r)
                        return null;
                    var n = this.doPrivate(r);
                    if (null == n)
                        return null;
                    var a = n.toString(16);
                    return 0 == (1 & a.length) ? a : "0" + a
                },
                t.prototype.verify = function (t, e, i) {
                    var r = F(e, 16),
                        n = this.doPublic(r);
                    return null == n ? null : function (t) {
                        for (var e in X)
                            if (X.hasOwnProperty(e)) {
                                var i = X[e],
                                    r = i.length;
                                if (t.substr(0, r) == i)
                                    return t.substr(r)
                            }
                        return t
                    }
                    /*!
                    Copyright (c) 2011, Yahoo! Inc. All rights reserved.
                    Code licensed under the BSD License:
                    http://developer.yahoo.com/yui/license.html
                    version: 2.9.0
                    */
                    (n.toString(16).replace(/^1f+00/, "")) == i(t).toString()
                },
                t
        }();
    </script>
</body>

</html>